<style>
    .layui-form-label {
        width: 100px;
    }

    .layui-input-block {
        margin-left: 130px;
    }
</style>
<div class="rightcontent rc-bg-grey">
    <div class="rc-pagepadding ">
        <div class=" rc-pannel layui-form">

            <div class="rc-pannel-body  rc-pagepadding">

                <div class="layui-form-item">
                    <label class="layui-form-label">站点标识</label>
                    <div class="layui-input-block" style="padding-top: 5px;">
                        <?php echo $siteinfo['ident']; ?>
                        <input type="hidden" value="<?php echo $siteinfo['ident']; ?>" name="ident" />
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">站点域名
                        <i class="layui-icon layui-icon-question rc-tips rc-pointer" message="如需更改，请通知超管进入配置中心修改"></i>
                    </label>

                    <div class="layui-input-block" style="padding-top: 5px;">
                        <?php echo $siteinfo['protocol']; ?> <?php echo $siteinfo['domain']; ?>
                        <input type="hidden" value="<?php echo $siteinfo['protocol']; ?>" name="protocol" />
                        <input type="hidden" value="<?php echo $siteinfo['domain']; ?>" name="domain" />

                    </div>
                </div>


                <div class="layui-form-item">
                    <label class="layui-form-label">站点名称</label>
                    <div class="layui-input-block">
                        <input type="text" name="title" autocomplete="off" value="<?php echo $siteinfo['title'] ?>" lay-verify="required" class="layui-input" />

                    </div>
                </div>




                <div class="layui-form-item">
                    <label class="layui-form-label">站点LOGO</label>
                    <div class="layui-input-block">
                        <?php echo element('singleimage', name: 'logo', value: $siteinfo['logo']); ?>

                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">关键词</label>
                    <div class="layui-input-block">
                        <input type="text" name="keyword" autocomplete="off" value="<?php echo $siteinfo['keyword'] ?>" class="layui-input" />

                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">简介描述</label>
                    <div class="layui-input-block">
                        <textarea class="layui-textarea" name="desc"><?php echo $siteinfo['desc'] ?></textarea>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">icp备案号
                        <i class="layui-icon layui-icon-question rc-tips rc-pointer" message="支持HTML代码"></i>
                    </label>
                    <div class="layui-input-block">
                        <textarea class="layui-textarea" name="icp"><?php echo $siteinfo['icp'] ?></textarea>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">统计代码
                        <i class="layui-icon layui-icon-question rc-tips rc-pointer" message="支持HTML代码"></i>
                    </label>
                    <div class="layui-input-block">
                        <textarea class="layui-textarea" name="statistics"><?php echo $siteinfo['statistics'] ?></textarea>
                    </div>
                </div>


                <div class="layui-form-item">
                    <label class="layui-form-label">站点主题
                        <i class="layui-icon layui-icon-question rc-tips rc-pointer" message="站点主题不是必须，如果填写，则前台模板路径为/template/home/站点标识/主题"></i>
                    </label>
                    <div class="layui-input-block">
                        <input type="text" name="theme" autocomplete="off" value="<?php echo $siteinfo['theme'] ?>" class="layui-input" />

                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">状态</label>
                    <div class="layui-input-block">
                        <select name="status">
                            <option value="1" <?php echo $siteinfo['status'] == 1 ? 'selected' : '' ?>>正常</option>
                            <option value="-1" <?php echo $siteinfo['status'] == -1 ? 'selected' : '' ?>>关闭</option>
                        </select>
                    </div>
                </div>

                <div class="layui-form-item rc-margin-bottom0">
                    <div class="layui-input-block">
                        <button type="button" class="layui-btn layui-btn-primary layui-btn-sm" lay-submit lay-filter="submit">提交</button>
                        <button type="reset" class="layui-btn layui-btn-sm">重置</button>
                    </div>
                </div>

            </div>



        </div>

    </div>
</div>

<script>
    layui.use(function() {

        var form = layui.form;
        form.on('submit(submit)', function(data) {
            var fielddata = data.field;
            delete fielddata['logo_file'];
            $.ajax({
                url: '/admin/Site/basicinfo', //请求路径
                type: "POST", //请求方式
                data: data.field, // 默认写法
                success: function(data) {
                    if (data.code == 0) {
                        toastr_success("设置成功");
                    } else {
                        toastr_error(data.message);
                    }
                },
                error: function() {

                },

            });
        });



    });
</script>